package com.operate.api.app.term.service.impl;

import cn.dev33.satoken.stp.StpUtil;
import com.operate.api.app.message.dao.AppMessageDao;
import com.operate.api.app.message.domain.vo.AppMessageSearchVO;
import com.operate.api.app.message.domain.vo.AppMessageVO;
import com.operate.api.app.term.dao.AppTermDao;
import com.operate.api.app.term.domain.po.AppTermPO;
import com.operate.api.app.term.domain.vo.AppTermVO;
import com.operate.api.app.term.service.IAppTermService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example;

import java.util.List;


@Service
@Transactional
@Slf4j
public class AppTermServiceImpl implements IAppTermService {

    @Autowired
    private AppTermDao dao;
    @Override
    public AppTermVO getOne(Integer type) {
        Example example=new Example(AppTermPO.class);
        example.and().andEqualTo("termType",type);
        AppTermPO appTermPO=dao.selectOneByExample(example);
        AppTermVO appTermVO=new AppTermVO();
        BeanUtils.copyProperties(appTermPO, appTermVO);
        return appTermVO;
    }
}